<?php
	ob_start();
	error_reporting(E_ALL);
	ini_set('include_path','.' . PATH_SEPARATOR . dirname(__FILE__));
	
	if (empty($noSession)){    
    	session_start();
    	//mb_internal_encoding("UTF-8");
    	//header('Content-Type','text/html; charset=UTF-8');
    }
	
	require_once 'lib/logger.php';

	require_once 'func/func.php';

	require_once 'lib/url.php';
	require_once 'lib/request.php';
	require_once 'lib/events.php';
	require_once 'lib/ierror.php';
	require_once 'lib/core.php';
	
	require_once 'lib/controller.php';
	require_once 'lib/app.controller.php';
	require_once 'lib/view.php';
	require_once 'lib/filter.php';
    require_once 'lib/html/form.php';

	require_once 'lib/validator.php';
	require_once 'lib/mailer.php';
	
	require_once 'lib/db/db.php';
	require_once 'lib/db/db_table.php';

	require_once 'lib/file/file.php';
	require_once 'lib/file/image.php';
	
	require_once 'lib/json.php';
    require_once('lib/xml2json.php');
    
	require_once 'lib/sorter.php';
	require_once 'lib/pager.php';

    // autoload models
    foreach (glob(_cfg("path")."/_inc/lib/model/*.php") as $model)
        include_once ($model);
        
	global $app;
	$app = new Core();

